package model

import "time"

//Page 分页参数
type PageInfo struct {
	Limit   int `form:"limit" json:"limit" xml:"limit"  binding:"required,min=0,max=50"` //每页条数
	PageNum int `form:"pageNum" json:"pageNum" xml:"pageNum"  binding:"required"`        //当前页
}

type TimeInfo struct {
	StartAt time.Time `form:"startAt" json:"startAt" xml:"startAt"` //开始时间
	EndAt   time.Time `form:"endAt" json:"endAt" xml:"endAt"`       //结束时间
}

type TimeRelationInfo struct {
	TID uint `form:"tid" json:"tid" xml:"tid"` //开始时间
	UID uint `form:"uid" json:"uid" xml:"uid"` //结束时间
}

//BaseQueryInfo 基础查询信息
type BaseQueryInfo struct {
	PageInfo
	TimeInfo
}

//LoginInfo 通过账号密码登陆参数
type LoginInfo struct {
	Account   string `form:"account" json:"account" xml:"account"  binding:"required,max=32"`
	Password  string `form:"password" json:"password" xml:"password"  binding:"required,max=32"`
	CaptchaId string `form:"captchaId" json:"captchaId" xml:"captchaId"  binding:"required"`
	Code      string `form:"code" json:"code" xml:"code"  binding:"required,len=4"`
}

//TokenLoginInfo 通过RefreshToken登陆参数
type TokenLoginInfo struct {
	RefreshToken string `form:"refreshToken" json:"refreshToken" xml:"refreshToken"  binding:"required"`
}

//RegisterInfo 注册信息参数
type RegisterInfo struct {
	Account   string `form:"account" json:"account" xml:"account"  binding:"required,min=3,max=32"`
	Password  string `form:"password" json:"password" xml:"password"  binding:"required,min=3,max=32"`
	Mobile    string `form:"mobile" json:"mobile" xml:"mobile"  binding:"required,len=11"`
	CaptchaId string `form:"captchaId" json:"captchaId" xml:"captchaId"  binding:"required"`
	Code      string `form:"code" json:"code" xml:"code"  binding:"required,len=4"`
	Name      string
}

//ApplicationInfo 添加应用参数
type ApplicationInfo struct {
	AppType        uint8  `form:"appType" json:"appType" xml:"appType"  binding:"required"`
	Polymerization bool   `form:"polymerization" json:"polymerization" xml:"polymerization"  binding:"required"`
	Name           string `form:"name" json:"name" xml:"name"  binding:"required,min=1,max=32"`
	Describe       string `form:"describe" json:"describe" xml:"describe"  binding:"max=255"`
	TID            uint   `form:"tid" json:"tid" xml:"tid"`
}

//TeamInfo 团队信息
type TeamInfo struct {
	Name   string `form:"name" json:"name" xml:"name"  binding:"required"`
	Remark string `form:"remark" json:"remark" xml:"remark"  binding:"max=255"`
}

type LogAuthInfo struct {
	Name        string      `form:"name" json:"name" xml:"name"`
	TrackerId   string      `form:"trackerId" json:"trackerId" xml:"trackerId" binding:"required"`
	SdkVersion  string      `form:"sdkVersion" json:"sdkVersion" xml:"sdkVersion"`
	Version     string      `form:"version" json:"version" xml:"version" `
	Env         string      `form:"env" json:"env" xml:"env"`
	Uin         string      `form:"uin" json:"uin" xml:"uin"`
	IPAddr      string      `form:"ipAddr" json:"ipAddr" xml:"ipAddr"`
	Addr        string      `form:"addr" json:"addr" xml:"addr"`
	SessionID   string      `form:"sessionID" json:"sessionID" xml:"sessionID"`
	Apikey      string      `form:"apikey" json:"apikey" xml:"apikey"  binding:"required"`
	OS          string      `form:"os" json:"os" xml:"os"`
	BrowserInfo interface{} `form:"browserInfo" json:"browserInfo" xml:"browserInfo"`
	NetworkType string      `form:"networkType" json:"networkType" xml:"networkType"`
	CreateAt    time.Time   `form:"createAt" json:"createAt" xml:"createAt"`
}
type LogDataInfo struct {
	Time       string      `form:"time" json:"time" xml:"time"`
	ReportTime time.Time   `form:"reportTime" json:"reportTime" xml:"reportTime"`
	Url        string      `form:"url" json:"url" xml:"url"`
	Name       string      `form:"name" json:"name" xml:"name"`
	Level      string      `form:"level" json:"level" xml:"level" `
	Message    string      `form:"message" json:"message" xml:"message" `
	Stack      interface{} `form:"stack" json:"stack" xml:"stack"`
	Ext        interface{} `form:"ext" json:"ext" xml:"ext"`
	Ext1       interface{} `form:"ext1" json:"ext1" xml:"ext1"`
	Ext2       interface{} `form:"ext2" json:"ext2" xml:"ext2"`
	Type       string      `form:"type" json:"type" xml:"type" `
	ErrorId    string      `form:"errorId" json:"errorId" xml:"errorId" `
}
type LogInfo struct {
	Data       LogDataInfo   `form:"data" json:"data" xml:"data"  binding:"required"`
	AuthInfo   LogAuthInfo   `form:"authInfo" json:"authInfo" xml:"authInfo"  binding:"required"`
	Breadcrumb []interface{} `form:"breadcrumb" json:"breadcrumb" xml:"breadcrumb" `
}
